﻿CREATE PROCEDURE [dbo].[Purchase_GetItemInfo]
	@purchaseId BIGINT
AS
BEGIN
	--DECLARE @chapterId UNIQUEIDENTIFIER
	--DECLARE @bookId UNIQUEIDENTIFIER
	--DECLARE @cost NVARCHAR(128)
	--DECLARE @chapterName NVARCHAR (MAX)
	--DECLARE @chapterHashCode NVARCHAR (128)
	--DECLARE @isPublishedChapter BIT

	
	--SELECT @chapterId = ch.[ChapterId], @bookId = ch.[BookId], @cost = ch.[Cost], @chapterName = ch.[Title], @chapterHashCode = ch.[HashTag], @isPublishedChapter = ch.[IsPublished]
 -- FROM [dbo].[purchase_Item] AS pitem
	--INNER JOIN [dbo].[text_Chapter] AS ch ON pitem.[ChapterId] = ch.[ChapterId]
	--WHERE [PurchaseId] = @purchaseId

	--DECLARE @bookName NVARCHAR(MAX)

	--SELECT @bookName = [Title]
	--FROM [dbo].[text_Chapter]
	--WHERE [BookId] = @bookId AND [ParentChapterId] IS NULL
		

	SELECT [PurchaseId]
				,[Value]
				--,[BookId]
  FROM [dbo].[purchase_Item]
	WHERE [PurchaseId] = @purchaseId
END